﻿<?php
session_start();

//require ('quanju.php');

$servername = "localhost";
$username = "anters02mysql";
$password = "1023315123";
$dbname = "anters02mysql";

// 创建连接
$conn = new mysqli($servername, $username, $password, $dbname);
// 检测连接
if ($conn->connect_error) {
    die("连接数据库失败: " . $conn->connect_error);
}
/*$sql = "CREATE TABLE hg002 (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
sjh VARCHAR(30) NOT NULL,
pw VARCHAR(30) NOT NULL,
wd VARCHAR(50),
imglj VARCHAR(400),
bttb VARCHAR(50),
jkm INT(5),
jkmsj INT(10) UNSIGNED,
js VARCHAR(50),
version VARCHAR(50),
ext VARCHAR(250),
reg_date TIMESTAMP
);";
$sql .= "INSERT INTO hg002 (sjh, pw)
VALUES ('18307526477', 'a1023315123');";
$sql = "INSERT INTO hg002 (sjh, pw)
VALUES ('18316069201', '123456');";
$sql .= "INSERT INTO hg002 (sjh, pw)
VALUES ('13178590360', '123456');";
$sql .= "INSERT INTO hg002 (sjh, pw)
VALUES ('13662901213', '123456');";
$sql .= "INSERT INTO hg002 (sjh, pw)
VALUES ('15917321813', '123456');";
$sql .= "INSERT INTO hg002 (sjh, pw)
VALUES ('13723516370', '123456');";
$sql .= "INSERT INTO hg002 (sjh, pw)
VALUES ('15625702153', '123456');";*/
$sql = "INSERT INTO hg002 (sjh, pw)
VALUES ('15818251104', '123456');";
 
if ($conn->multi_query($sql) === TRUE) {
    echo "新记录插入成功";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
exit();
if(!isset($_SESSION['login']) || $_SESSION['login'] != 1)
{
	if(strlen($_POST['sjh']) <= 0)exit('手机号不能为空');
	if(strlen($_POST['pw']) <= 6)exit('密码错误');

	if(file_exists('zh/'.$_POST['sjh']) == false)exit('无此号码');

	$pwfile = 'zh/'.$_POST['sjh'].'/pw.php';
	if(file_exists($pwfile) == false)exit('无此号码');
	require($pwfile);
	if($pw != $_POST['pw'])exit('密码错误');
	$_SESSION['sjh'] = $_POST['sjh'];
	$_SESSION['login'] = 1;

	if($_GET['tz'] && $_GET['tz'] == "1")
	{
		header("Location:002.php");
	}
	else
	{
		exit("1");
	}
}
if($_GET['tz'] && $_GET['tz'] == "1")
{
	header("Location:002.php");
}

exit('1');
?>
